package com.nine.sensitive.result;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class R {

    private int code;

    private String msg;

    private Object data;

    public static R ok() {
        return new R(200, "成功", null);
    }

    public static R ok(Object data) {
        return new R(200, "成功", data);
    }

    public static R error() {
        return new R(500, "失败", null);
    }

    public static R error(Object data) {
        return new R(500, "失败", data);
    }

}
